package com.yunhai.xc.test;

import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/shiro")
public class Shiro {
	@RequestMapping("/p1")
	@RequiresPermissions("admin:shiro")
	public String test1() {
		return "shiro/shiro1";
	}

	@RequestMapping("/p2")
	@RequiresPermissions("shiro:shiro")
	public String test2() {
		return "shiro/shiro2";
	}
	
	@RequiresAuthentication
	@RequestMapping("/p3")
	public String test3() {
		return "shiro/shiro2";
	}

	@RequestMapping("/403")
	public String unauthorizedRole() {
		return "shiro/403";
	}
}
